using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.ExpressApp.DC;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo;
using DevExpress.Persistent.Validation;
namespace Ascent.QiPei.Module.BusinessObjects.Base
{
  [DefaultClassOptions]
  [DevExpress.Persistent.Base.NavigationItemAttribute("基础数据")]
  [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("供应商")]
  public partial class Supplier : DevExpress.Persistent.BaseImpl.BaseObject
  {
    private Ascent.QiPei.Module.BusinessObjects.Finance.AccountPayable _accountPayable;
    private Ascent.QiPei.Module.BusinessObjects.Purchase.PurchasingReturn _purchasingReturn;
    private Ascent.QiPei.Module.BusinessObjects.Purchase.Inquiry _inquiry;
    private System.Boolean _isActive;
    private System.String _remarks;
    private System.String _billToAddressID;
    private System.String _bankNumber;
    private System.String _accountBank;
    private System.String _accountName;
    private System.String _webSite;
    private System.String _zip;
    private System.String _address;
    private System.String _fax;
    private System.String _telephone;
    private System.String _longName;
    private System.String _shortName;
    private System.String _supplierCode;
    public Supplier(DevExpress.Xpo.Session session)
      : base(session)
    {
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("供应商编码")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String SupplierCode
    {
      get
      {
        return _supplierCode;
      }
      set
      {
        SetPropertyValue("SupplierCode", ref _supplierCode, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("简称")]
    [RuleRequiredField(DefaultContexts.Save)]
    public System.String ShortName
    {
      get
      {
        return _shortName;
      }
      set
      {
        SetPropertyValue("ShortName", ref _shortName, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("全称")]
    public System.String LongName
    {
      get
      {
        return _longName;
      }
      set
      {
        SetPropertyValue("LongName", ref _longName, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("电话")]
    public System.String Telephone
    {
      get
      {
        return _telephone;
      }
      set
      {
        SetPropertyValue("Telephone", ref _telephone, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("传真")]
    public System.String Fax
    {
      get
      {
        return _fax;
      }
      set
      {
        SetPropertyValue("Fax", ref _fax, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("地址")]
    public System.String Address
    {
      get
      {
        return _address;
      }
      set
      {
        SetPropertyValue("Address", ref _address, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("邮政编码")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String Zip
    {
      get
      {
        return _zip;
      }
      set
      {
        SetPropertyValue("Zip", ref _zip, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("公司网址")]
    public System.String WebSite
    {
      get
      {
        return _webSite;
      }
      set
      {
        SetPropertyValue("WebSite", ref _webSite, value);
      }
    }
    [DevExpress.Xpo.AssociationAttribute("Contacts-Supplier")]
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("联系人")]
    public XPCollection<Ascent.QiPei.Module.BusinessObjects.Base.Contact> Contacts
    {
      get
      {
        return GetCollection<Ascent.QiPei.Module.BusinessObjects.Base.Contact>("Contacts");
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("户名")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String AccountName
    {
      get
      {
        return _accountName;
      }
      set
      {
        SetPropertyValue("AccountName", ref _accountName, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("开户行")]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    public System.String AccountBank
    {
      get
      {
        return _accountBank;
      }
      set
      {
        SetPropertyValue("AccountBank", ref _accountBank, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("银行帐号")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String BankNumber
    {
      get
      {
        return _bankNumber;
      }
      set
      {
        SetPropertyValue("BankNumber", ref _bankNumber, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("开票地址")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String BillToAddressID
    {
      get
      {
        return _billToAddressID;
      }
      set
      {
        SetPropertyValue("BillToAddressID", ref _billToAddressID, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("备注")]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    public System.String Remarks
    {
      get
      {
        return _remarks;
      }
      set
      {
        SetPropertyValue("Remarks", ref _remarks, value);
      }
    }
    [DevExpress.ExpressApp.DC.XafDisplayNameAttribute("是否可用")]
    [DevExpress.Persistent.Base.VisibleInListViewAttribute(false)]
    [DevExpress.Persistent.Base.VisibleInLookupListViewAttribute(false)]
    public System.Boolean IsActive
    {
      get
      {
        return _isActive;
      }
      set
      {
        SetPropertyValue("IsActive", ref _isActive, value);
      }
    }
    //[System.ComponentModel.BrowsableAttribute(false)]
    //public Ascent.QiPei.Module.BusinessObjects.Purchase.PurchasingOrder PurchasingOrder
    //{
    //  get
    //  {
    //    return _purchasingOrder;
    //  }
    //  set
    //  {
    //    if (_purchasingOrder == value)
    //      return;
    //    Ascent.QiPei.Module.BusinessObjects.Purchase.PurchasingOrder prevPurchasingOrder = _purchasingOrder;
    //    _purchasingOrder = value;
    //    if (IsLoading)
    //      return;
    //    if (prevPurchasingOrder != null && prevPurchasingOrder.Supplier == this)
    //      prevPurchasingOrder.Supplier = null;
    //    if (_purchasingOrder != null)
    //      _purchasingOrder.Supplier = this;
    //    OnChanged("PurchasingOrder");
    //  }
    //}
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Purchase.Inquiry Inquiry
    {
      get
      {
        return _inquiry;
      }
      set
      {
        if (_inquiry == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Purchase.Inquiry prevInquiry = _inquiry;
        _inquiry = value;
        if (IsLoading)
          return;
        if (prevInquiry != null && prevInquiry.Supplier == this)
          prevInquiry.Supplier = null;
        if (_inquiry != null)
          _inquiry.Supplier = this;
        OnChanged("Inquiry");
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Purchase.PurchasingReturn PurchasingReturn
    {
      get
      {
        return _purchasingReturn;
      }
      set
      {
        if (_purchasingReturn == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Purchase.PurchasingReturn prevPurchasingReturn = _purchasingReturn;
        _purchasingReturn = value;
        if (IsLoading)
          return;
        if (prevPurchasingReturn != null && prevPurchasingReturn.Supplier == this)
          prevPurchasingReturn.Supplier = null;
        if (_purchasingReturn != null)
          _purchasingReturn.Supplier = this;
        OnChanged("PurchasingReturn");
      }
    }
    [System.ComponentModel.BrowsableAttribute(false)]
    public Ascent.QiPei.Module.BusinessObjects.Finance.AccountPayable AccountPayable
    {
      get
      {
        return _accountPayable;
      }
      set
      {
        if (_accountPayable == value)
          return;
        Ascent.QiPei.Module.BusinessObjects.Finance.AccountPayable prevAccountPayable = _accountPayable;
        _accountPayable = value;
        if (IsLoading)
          return;
        if (prevAccountPayable != null && prevAccountPayable.Supplier == this)
          prevAccountPayable.Supplier = null;
        if (_accountPayable != null)
          _accountPayable.Supplier = this;
        OnChanged("AccountPayable");
      }
    }
  }
}
